package net.ojbk.study.curriculumDesign.web.handlers.cilentservicer;

import net.ojbk.study.curriculumDesign.beans.cilentservicer.ChatMessage;
import net.ojbk.study.curriculumDesign.beans.cilentservicer.Servicer;
import net.ojbk.study.curriculumDesign.beans.usermanage.User;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpSession;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/1/8
 * Time: 14:28
 * Description: No Description
 */
public interface IServicerController {
    /**
     * 查看是否有新消息
     *
     * @param httpSession
     * @return
     */
    public ResponseEntity<Object> isHaveNewMsg(HttpSession httpSession);

    /**
     * 设置客服状态
     *
     * @param httpSession
     * @param newStatus   新状态代码
     * @return
     */
    public ResponseEntity<Object> setMeStatus(HttpSession httpSession, int newStatus);

    /**
     * 获取自己的评分
     *
     * @param httpSession
     * @return 分数
     */
    public ResponseEntity<Object> getMeScore(HttpSession httpSession);

    /**
     * 连接一个客户
     *
     * @param httpSession
     * @param user         客户的编号
     * @return
     */
    public ResponseEntity<Object> joinChat(HttpSession httpSession, User user);

    /**
     * 获取所有与该用户的一条新消息
     *
     * @param httpSession
     * @return
     */
    public ResponseEntity<Object> getnewMsg(HttpSession httpSession, String uid);

    /**
     * 发送一条新消息
     *
     * @param httpSession
     * @param chatMessage 新的消息
     * @return
     */
    public ResponseEntity<Object> sendNewMsg(HttpSession httpSession, String uid, ChatMessage chatMessage);

    /**
     * 断开连接
     *
     * @param httpSession
     * @param uid         被断开的用户id
     * @return
     */
    public ResponseEntity<Object> catChat(HttpSession httpSession, String uid);


    /**
     * 获取客服的信息
     *
     * @param session
     * @return Servicer对象 但是不包括最后一个最后一个属性(聊天记录)
     */
    public ResponseEntity<Object> getServiceInfo(HttpSession session);
}
